package com.itheima.oneToOne;

import com.itheima.bean.Classes;
import com.itheima.bean.Student;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CardMapper {
    @Select("select * from student")
    @Results({
            @Result(id=true,property = "id",column = "id"),
            @Result(property = "name",column = "name"),
            @Result(property = "age",column = "age"),
            @Result(
                    property = "person",column = "pid",
                    javaType = Classes.class,
                    one = @One(select = "com.itheima.oneToOne.PersonMapper.findByPid")
            )
    })
    public List<Student>  findAll();

}
